package it.polimi.TravelDream;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the packagejoin database table.
 * 
 */
@Embeddable
public class PackagejoinPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false)
	private int IDJoiner;

	@Column(insertable=false, updatable=false)
	private int IDPackage;

	public PackagejoinPK() {
	}
	public int getIDJoiner() {
		return this.IDJoiner;
	}
	public void setIDJoiner(int IDJoiner) {
		this.IDJoiner = IDJoiner;
	}
	public int getIDPackage() {
		return this.IDPackage;
	}
	public void setIDPackage(int IDPackage) {
		this.IDPackage = IDPackage;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PackagejoinPK)) {
			return false;
		}
		PackagejoinPK castOther = (PackagejoinPK)other;
		return 
			(this.IDJoiner == castOther.IDJoiner)
			&& (this.IDPackage == castOther.IDPackage);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.IDJoiner;
		hash = hash * prime + this.IDPackage;
		
		return hash;
	}
}